package designPattern.action11.stage.c20t2;

import designPattern.action11.stage.c20t2.concrete.HeightState;
import designPattern.action11.stage.c20t2.concrete.LowState;
import designPattern.action11.stage.c20t2.concrete.MiddleState;
import designPattern.action11.stage.c20t2.sketch.TemperatureState;
import designPattern.action11.stage.c20t2.sketch.Thermometer;

/*
状态模式和策略模式很相似。。



*/


public class Application {
    public static void main(String args[]) {
        Thermometer thermometer = new Thermometer();
        TemperatureState state;

        state = new LowState(-12);
        thermometer.setState(state);
        thermometer.showMessage();


        state = new MiddleState(20);
        thermometer.setState(state);
        thermometer.showMessage();

        state = new HeightState(39);
        thermometer.setState(state);
        thermometer.showMessage();
    }
}
